package chixing.day05;

public class BookTest {
    public static void main(String[] args) {
        Library library = new Library();

        Book book6 = new Book(6,"重构","Fowler",true);
        library.addBook(book6);

        library.displayAvailableBooks();

        System.out.println("根据书的编号查阅书------------");
        Book book1 = library.getBookByISBN(1);
        Book book2 = library.getBookByISBN(2);

        Book book3 = library.getBookByISBN(3);
        Book book4 = library.getBookByISBN(4);


        System.out.println("用户1111借书-----------------");
        User user1 = new User(101,"allen");
        boolean result1=  user1.borrowBook(book1);
        boolean result2=  user1.borrowBook(book2);
        user1.returnBook(book2);
        user1.listBorrowedBooks();
        // 打印出 user1 借书信息
        System.out.println("用户2222借书-----------------");
        User user2 = new User(102,"Walter");
        user2.borrowBook(book1);  // false
        user2.borrowBook(book4);  // true
        user2.borrowBook(book2);
        user2.listBorrowedBooks();
        // 打印出 user2 借书信息

    }
}
